<html>

<head>
<title><g:layoutTitle default="Grails" />
</title>
<link rel="stylesheet" href="${resource(dir:'css',file:'main.css')}" />
<link rel="stylesheet"
	href="${resource(dir:'css',file:'ddsmoothmenu.css')}" />
<link rel="shortcut icon"
	href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
<g:layoutHead />
<g:javascript library="application" />
<g:javascript library="jquery.min" />
<g:javascript library="ddsmoothmenu" />
<g:javascript library="ddsmenu_init" />
<g:javascript library="application" />

<script type="text/javascript" charset="UTF-8">
jQuery.noConflict();
var $j = jQuery;
var mainMenuWidth = 0;
var windowContainerMarginLeft = 0;
var mainMenuCollapsedWidth = '32px';
var janelaDivCollapsedMarginLeft = '15px';
var titleCollapsed = "Mostrar menu"
	  var TitleUncolappsed = "Clique para esconder o menu, este texto pode ser editado.."

$j(document).ready(function () { 
    $j('.list, .create, .home').each(function() {
        var url = this.getAttribute('href');
        this.setAttribute('onclick', 'fechaJanelaEAbreUrl(\''+ url + '\');return false;');
    });

   $j("#janelaDiv").animate({
     top: '20px',
     left: '-110px',
     right: '30px',
     marginRight: '-80px',
     opacity: 1
   }, 600 );
   $j('.windowTitle').html($j('#pageName').html());
   $j('#pageName').hide();

   
});


function fechaJanelaEAbreUrl(url) {

      $j("#janelaDiv").animate({
              top: '30px',
              left: '30px',
              marginRight: '70px',
              opacity: 0.0
      }, 600 );
 window.setTimeout('open(\''+url+'\',\'_self\')',600);
}
function fechaJanela() {
	//top: 10; left:-120 ; right: 10px; margin-right: -70; opacity: 10;
      $j("#janelaDiv").animate({
              top: '30px',
              left: '30px',
              marginRight: '70px',
              opacity: 0.0
      }, 600 );
}
function toogleContentContainer(){
$j('.IadWindowContentContainer').slideToggle(500);
var backGroundPosition = $j('.slideToggle').css('background-position');
if(backGroundPosition == "0px 0px"){
    $j('.slideToggle').css('background-position', '0px -16px');
    $j('.IadWindowHeadContainer').addClass('IadRounded');
    //$j('.windowTitle').html($j('.body h1').html());
}else{
    $j('.slideToggle').css('background-position', '0px 0px');
    $j('.IadWindowHeadContainer').removeClass('IadRounded');
    //$j('.windowTitle').html('');
}
}
 
 </script>
 
<style type="text/css">
.jasperReport_link{
	background-image: -moz-linear-gradient(center top , #FFFAFA, #DCDCDC);
	border-bottom: 1px solid gray;
	border-top-width: 0;
    font: 13px Verdana;
    margin: 0;
    padding: 5px;
    width: 160px;
}

</style>
</head>
<body>
	<div class="back">
		<div id="spinner" class="spinner" style="display: none;">
			<img src="${resource(dir:'images',file:'spinner.gif')}" alt="Spinner" />
		</div>
		<div class="header IadRoundedTop">
			<div class="logo"></div>
			<h1>CASH+SCO SISTEMA DE GESTAO FINANCEIRA & OBRAS</h1>
			<div class="sysDate">
				Data:
				<g:formatDate
					format="${message(code: '${date.format.precision.day}', default: 'dd/MM/yyyy')}"
					date="${new Date()}" />
				- Vers&atilde;o
				<g:meta name="app.version" />
			</div>
			<shiro:isLoggedIn>
				<div class="">
					<p>
						Usuario: <strong><shiro:principal /><strong>
					</p>
					<div class="">
						<g:link controller="auth" action="signOut">Sair</g:link>
					</div>
				</div>
			</shiro:isLoggedIn>
		</div>

		<shiro:isLoggedIn>
			<div id="smoothmenu1" class="ddsmoothmenu">
				<ul>
					<li><a href="http://localhost:8080/CashFinancas/">Home</a>
					</li>
					<li><a href="#">Cadastros Usuários</a>
						<ul>
							<li><g:link controller="shiroUser" action="index">Controle de Usu&aacute;rios</g:link>
							</li>
							<li><g:link controller="shiroRole" action="index">Controle de Perfil de Usu&aacute;rios</g:link>
							</li>
						</ul>
					<li><a href="#">Cadastros Básicos</a>
						<ul>
							<li><g:link controller="cliente" action="index">Clientes</g:link>
							</li>
							<li><g:link controller="fornecedor" action="index">Fornecedores</g:link>
							</li>
							<li><g:link controller="obra" action="index">Obras</g:link>
							</li>
							<li><g:link controller="insumo" action="index">Insumo</g:link>
							</li>
							<li><g:link controller="contasCorrente" action="index">Contas Correntes</g:link>
							</li>
							<li><g:link controller="contaContabil" action="index">Contas Cont&aacute;beis</g:link>
							</li>
							<li><g:link controller="tipoDeOperacao" action="index">Tipos de Operação</g:link>
							</li>
						</ul></li>
					<li><a href="#">Movimentos</a>
						<ul>
							<li><g:link controller="venda" action="index">Vendas</g:link>
							</li>
							<li><g:link controller="gastos" action="index">Gastos</g:link>
							</li>
							<li><g:link controller="contasCorrente" action="conciliacao">Conciliação bancária</g:link>
							</li>
							<li><g:link controller="contasReceber" action="list">Contas Receber</g:link>
							</li>
							<li><g:link controller="contasPagar" action="list">Contas Pagar</g:link>
							</li>
						</ul></li>
					<li><a href="#">Relatórios</a>
						<ul>
							<li><g:link controller="fluxoCaixa" action="index">Fluxo de caixa</g:link>
							</li>
						</ul></li>
				</ul>
				<br style="clear: left" />
			</div>
		</shiro:isLoggedIn>
		<shiro:isLoggedIn>
		<div id="janelaDiv" class="IadWindowContainer IadRounded">
			<div class="IadWindowHeadContainer IadRoundedTop shadow">
				<div class="IadWindowHead">
					<a href="" class="close"
						onclick="javascript:fechaJanela(); return false;"
						title="Fecha esta janela.">&nbsp;</a> <a href=""
						class="slideToggle"
						onclick="javascript:toogleContentContainer(); return false;"
						title="Minimiza esta janela.">&nbsp;</a>
					<h1 class="windowTitle"></h1>
				</div>
			</div>
			<div class="IadWindowContentContainer IadRoundedBottom shadow">
				<div class="IadWindowContent">
					<g:layoutBody />
				</div>
			</div>
		</div>
		</shiro:isLoggedIn>
		<shiro:isNotLoggedIn>
			<div
				style="text-align: center; margin: 0pt auto; padding-top: 40px; padding-left: 200px">
				<script type="text/javascript">$j(document).ready(function () {$j('#username').focus();})</script>
				<g:form action="signIn" controller="auth" class="login shadow">
					<input type="hidden" name="targetUri" value="${targetUri}" />
					<p>
						<label class="tag required">Usuario:</label> <input type="text"
							name="username" id="username" value="${username}" />
					</p>
					<p>
						<label class="tag required">Senha:</label> <input type="password"
							name="password" value="" />
					</p>
					<p class="panelButton">
						<input type="submit" value="Entrar" />
					</p>
					<p>
						<g:link controller="solicitacaoAcesso" action="create">
						Novo usuário: Solicite seu acesso aqui</g:link>
					</p>

					<g:if test="${flash.message}">
						<div class="errors">
							${flash.message}
						</div>
					</g:if>
				</g:form>
			</div>
		</shiro:isNotLoggedIn>
	</div>

</body>
</html>

